/*
 * EatsStage.h
 *
 *  Created on: 04/02/2013
 *      Author: eusyar
 */

#ifndef EATSSTAGE_H_
#define EATSSTAGE_H_

#include "core/GameState.h"
#include "game/entities/Map.h"
#include "game/entities/Wave.h"
#include "game/entities/Mural.h"
#include "game/entities/TowerEntitie.h"
#include "game/entities/Nemlinium.h"

#include "util/EatsVars.h"


using namespace eats_core;
using namespace eats_vars;

class EatsStage : public GameState{

public:
	EatsStage(std::string _mapLocation, int nemliniumPosX = 738 ,	int nemliniumPosY = 379);
	virtual ~EatsStage();

	bool setUp();
	void update();
	bool render();
	void tearDown();

	virtual bool loadAndEnableEnemies() = 0;

	void lButtonDownEvent(int mX, int mY);
	void mouseMoveEvent(int mX,int mY, int relX, int relY, bool Left, bool Right, bool Middle);
	void keyDownEvent(SDLKey sym, SDLMod mod, Uint16 unicode);

	bool destroyNemlinium(int n);

	std::vector<BaseEnemy*> getEnemies();

protected:
	Map * map;
	Mural * hud;
	WaveHolder * _waveHolder;

	TowerEntitie * towerSelected;
	bool isTowerSelected;

	int towerSelectedSize;
	int _totalTime, _initTime;

	std::vector<Nemlinium *> nemliniumList;
	std::string mapLocation;

	bool isClickOnHud( Point click);

	int nemliniumOnStock;

	Point _nemliniumPosition;

};

#endif /* EATSSTAGE_H_ */
